<template>
  <div class="win" :style="deskWallpaper">
    <div class="start">
      <dl class="left">
        <dt></dt>
        <dd v-for="item in 8" :key="item">
          <span></span>
          <em></em>
        </dd>
      </dl>
      <dl class="right">
        <dt></dt>
        <dd v-for="item in 10" :key="item">
          <span>{{ item === 1 ? 'Aa' : '' }}</span>
        </dd>
      </dl>
    </div>
    <div class="text" v-if="isText">
      <div class="line"></div>
      {{ $t('default.example') }}
    </div>
    <div class="bar"></div>
  </div>
</template>

<script setup lang="ts">
import { useDeskWallpaperHook } from '@/hooks/systemWindowHooks'
import type { PropType } from 'vue'

defineProps({
  isText: {
    type: Boolean as PropType<boolean>,
    default: false
  }
})

const { deskWallpaper } = useDeskWallpaperHook()
</script>

<style scoped lang="scss">
.win {
  width: 330px;
  height: 175px;
  position: relative;
  margin-bottom: 50px;

  .start {
    position: absolute;
    left: 0;
    bottom: 12px;
    width: 158px;
    height: 120px;
    backdrop-filter: blur(5px);
    background-color: var(--task-bar-bg-color);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding-left: 8px;
    padding-right: 8px;

    dl {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      width: 30px;
      height: 93px;

      &.right {
        width: 75px;
        display: grid;
        grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
        grid-template-rows: 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
        grid-gap: 1px;
        grid-template-areas:
          'z z z z z z z'
          'a a a a a b b'
          'a a a a a b b'
          'a a a a a c c'
          'a a a a a c c'
          'd e h h h h h'
          'f g h h h h h'
          'i i i i j j j';

        dt {
          grid-area: z;
        }

        dd {
          width: 100%;
          height: 100%;
          margin: 0;

          &:nth-of-type(1) {
            grid-area: a;
          }

          &:nth-of-type(2) {
            grid-area: b;
          }

          &:nth-of-type(3) {
            grid-area: c;
          }

          &:nth-of-type(4) {
            grid-area: d;
          }

          &:nth-of-type(5) {
            grid-area: e;
          }

          &:nth-of-type(6) {
            grid-area: f;
          }

          &:nth-of-type(7) {
            grid-area: g;
          }

          &:nth-of-type(8) {
            grid-area: h;
          }

          &:nth-of-type(9) {
            grid-area: i;
          }

          &:nth-of-type(10) {
            grid-area: j;
          }

          > span {
            width: 100%;
            height: 100%;
            display: flex;
            justify-content: center;
            align-items: center;
          }
        }
      }

      dt {
        width: 30px;
        height: 2px;
        background-color: #fff;
        margin-bottom: 3px;
      }

      dd {
        width: 100%;
        margin-top: 1px;
        display: flex;
        align-items: center;

        span {
          display: inline-block;
          width: 10px;
          height: 10px;
          background-color: var(--theme-color);
        }

        em {
          display: inline-block;
          margin-left: 2px;
          width: calc(100% - 12px);
          height: 2px;
          background-color: #fff;
        }
      }
    }
  }

  .text {
    position: absolute;
    right: 28px;
    top: 30px;
    width: 116px;
    height: 106px;
    padding-left: 10px;
    box-sizing: border-box;
    border: 2px solid var(--theme-color);
    background-color: var(--system-modal-drag-bg-color);

    .line {
      margin-top: 6px;
      margin-bottom: 6px;
      width: 30px;
      height: 2px;
      background-color: #fff;
    }
  }

  .bar {
    width: 100%;
    height: 12px;
    position: absolute;
    left: 0;
    bottom: 0;
    backdrop-filter: blur(5px);
    background-color: var(--task-bar-bg-color);
  }
}
</style>
